package com.example.order.config;

public class TableServerResponse<T> {
    private Integer code;//状态码
    private T data;//数据
    private Long count;//数据的总条数

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Long getCount() {
        return count;
    }

    public void setCount(Long count) {
        this.count = count;
    }

    public TableServerResponse() {
    }

    public TableServerResponse(Integer code, T data, Long count) {
        this.code = code;
        this.data = data;
        this.count = count;
    }
    public TableServerResponse(T data, Long count) {
        this.code = code;
        this.data = data;
        this.count = count;
    }
    public TableServerResponse(Integer code,T data) {
        this.code = code;
        this.data = data;
    }

    public static <T> TableServerResponse createSuccess(Integer code, T data, Long count){
        return new TableServerResponse(code, data, count);
    }
    public static <T> TableServerResponse createSuccess(T data, Long count){
        return new TableServerResponse( data, count);
    }
    public static <T> TableServerResponse createSuccess(Integer code,T data){
        return new TableServerResponse(code,data);
    }
}
